Vim Tips Wiki:Featured Tip
Please discuss proposals for new Featured Tips on the talk page. Comments on the current featured tip can be added below (be bold!), or can be added to the comments section at the end. ---- Now THAT's a Good Tip! While most of the tips on this wiki are very helpful, every now and then, you'll stumble on a tip that shines above all the rest. Such a tip is a tip that changes the way you do a basic task, a tip that you try immediately and then use all the time, a tip that makes Vim integrate SO much better with your setup, or a tip that you just wish somebody gave to you when you started using Vim. We here on the Vim Tips Wiki recognize this, and therefore will -- about once a month -- feature a new tip that we feel is among the best of the best. So keep an eye on this page for life-altering (or at least mildly interesting) tips to add to your repertoire. This month's feature The featured tip this time around is [[VimTip1543|Tip 1543 Find in files within Vim]]. What's it about? Searching with / is easy, but in Vim, there's always more to learn! Check out this tip for how to search for text in files. A command like :vimgrep pattern *.txt will search all .txt files in the current directory for pattern, and :vimgrep pattern **/*.txt will search in the current directory and all its subdirectories. Using forward slashes for the file path works on Unix-based and Windows systems. Would you like to press a key to search for the current word in all files in and under the current directory? See [[VimTip1543|tip 1543 Find in files within Vim]] for details. Previously featured tips This is an archive of the Featured tip section on the Main Page (started in February 2008). We won't feature these tips again – however, they remain great tips! February 2008 Visual selection is useful for operating on a selected area: v for characters, V for lines, Ctrl-V (Ctrl-Q on Windows) for a block. You can extend the selection with normal commands such as j''' to move down, or '''w to move by a word, or / to search. Marks are automatically defined that specify the start and end of the visual selection. It's easy to search and replace within a visual selection – just type the normal :s/old/new/g command while in visual mode. You can also search the area that was visually selected – press Esc to exit visual mode, and start the search with /\%V rather than /. See [[VimTip438|tip 438 Search and replace in a visual selection]] for details. Comments I hadn't thought about putting summaries in the "Previously featured tips" section, but it's probably a good idea for now. However, once we've gotten a big enough list, I think we need to just provide links to most of them. I'd say a good goal would be to have a summary for the first 2 archived tips, and just a link to the rest. ---- Let's wait and see what it looks like when (if??) we get another couple of months done. Frankly, I'm rather pleased with what I wrote for February and March, and I have a feeling that it would be quite useful for a reader to peruse a list of the descriptions. If it keeps going, there could be a subpage with an archive of each year if there is too much on this page. --JohnBeckett 10:42, 25 March 2008 (UTC) ----